CC = gcc
TARGET = s_main
CFLAGS = -static -g
INCLUDE = -I./include/
LDFLAGS = -L./lib/
LIBS = -lFoo
LIB = libFoo.a
SUBDIR = ./src

main: main.c $(LIB)
	$(CC) $(CFLAGS) $(INCLUDE) $(LDFLAGS) main.c $(LIBS) -o $(TARGET)

$(LIB):
	cd $(SUBDIR) && $(MAKE)

.phony: clean 
clean:
	rm $(TARGET)
	cd $(SUBDIR) && $(MAKE) clean